Bug 1983713 - Use non-deprecated ast value. r=firefox-build-system-reviewers,nalexand...
authorMike Hommey <mh+mozilla@glandium.org>
Tue, 19 Aug 2025 05:08:34 +0000 (05:08 +0000)
committerMike Hommey <glandium@debian.org>
Wed, 19 Aug 2026 00:51:19 +0000 (09:51 +0900)
ast.Str was deprecated in python 3.12 and removed in 3.14. It inherited
from ast.Constant, `Str.s` was equivalent to `Constant.value`, so we can
use the latter on both old and newer python versions.

Differential Revision: https://phabricator.services.mozilla.com/D261511

Gbp-Pq: Topic fixes
Gbp-Pq: Name Bug-1983713-Use-non-deprecated-ast-value.-r-firefox-.patch

python/mach/mach/command_util.py

index 44e13f18d6cced02032cd78c1d49e7c99633a693..8539bf37b5b00e0f3f35162f0e8d7cf504418bbe 100644 (file)
@@ -292,7 +292,7 @@ class DecoratorVisitor(ast.NodeVisitor):
             kwarg_dict = {}
 
             for name, arg in zip(["command", "subcommand"], decorator.args):
-                kwarg_dict[name] = arg.s
+                kwarg_dict[name] = arg.value
 
             for keyword in decorator.keywords:
                 if keyword.arg not in relevant_kwargs: